package com.zyf.project.kvdb.protocol.proto.impl;

import com.zyf.project.kvdb.protocol.proto.ClusterItem;
import com.zyf.project.kvdb.protocol.proto.DatabaseClusterInfo;

/**
 * <h1>数据库实例集群信息</h1>
 * <p>实现了 {@link DatabaseClusterInfo} 接口</p>
 *
 * @author Zhou Yifan
 */
public class KVDBDatabaseClusterInfo implements DatabaseClusterInfo {

    /**
     * 是否是集群配置
     */
    private boolean clusterMode;
    /**
     * 如果是集群，那么就包含集群配置项
     */
    private ClusterItem clusterItem;

    /**
     * 判断是否是集群
     *
     * @return 布尔值
     */
    @Override
    public boolean isClusterMode() {
        return clusterMode;
    }

    public void setClusterMode(boolean clusterMode) {
        this.clusterMode = clusterMode;
    }

    /**
     * 获取集群项
     *
     * @return {@link ClusterItem}
     */
    @Override
    public ClusterItem getClusterItem() {
        return clusterItem;
    }

    public void setClusterItem(ClusterItem clusterItem) {
        this.clusterItem = clusterItem;
    }
}
